.class Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;
.super Landroid/widget/BaseAdapter;
.source "ReginaThemeSelector.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/regina/ReginaThemeSelector;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ThemeAdapter"
.end annotation


# instance fields
.field private mContext:Landroid/content/Context;

.field private mInflater:Landroid/view/LayoutInflater;

.field final synthetic this$0:Lcom/nemustech/regina/ReginaThemeSelector;


# direct methods
.method public constructor <init>(Lcom/nemustech/regina/ReginaThemeSelector;Landroid/content/Context;)V
    .locals 1
    .parameter
    .parameter "context"

    .prologue
    .line 33
    iput-object p1, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->this$0:Lcom/nemustech/regina/ReginaThemeSelector;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 34
    iput-object p2, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->mContext:Landroid/content/Context;

    .line 35
    const-string v0, "layout_inflater"

    invoke-virtual {p2, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    iput-object v0, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 36
    return-void
.end method


# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 40
    iget-object v0, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->this$0:Lcom/nemustech/regina/ReginaThemeSelector;

    invoke-static {v0}, Lcom/nemustech/regina/ReginaThemeSelector;->access$000(Lcom/nemustech/regina/ReginaThemeSelector;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "arg0"

    .prologue
    .line 45
    const/4 v0, 0x0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .parameter "position"

    .prologue
    .line 50
    const-wide/16 v0, 0x0

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 11
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    .line 55
    const/4 v2, 0x0

    .line 56
    .local v2, itemLayout:Landroid/view/ViewGroup;
    if-nez p2, :cond_1

    .line 57
    iget-object v8, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v9, 0x7f030011

    const/4 v10, 0x0

    invoke-virtual {v8, v9, p3, v10}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v2

    .end local v2           #itemLayout:Landroid/view/ViewGroup;
    check-cast v2, Landroid/view/ViewGroup;

    .line 62
    .restart local v2       #itemLayout:Landroid/view/ViewGroup;
    :goto_0
    iget-object v8, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->this$0:Lcom/nemustech/regina/ReginaThemeSelector;

    invoke-static {v8}, Lcom/nemustech/regina/ReginaThemeSelector;->access$000(Lcom/nemustech/regina/ReginaThemeSelector;)Ljava/util/ArrayList;

    move-result-object v8

    invoke-virtual {v8, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    .line 63
    .local v3, keyString:Ljava/lang/String;
    invoke-static {}, Lcom/nemustech/regina/ReginaThemeSelector;->access$100()Ljava/util/HashMap;

    move-result-object v8

    invoke-virtual {v8, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    .line 65
    .local v7, valueString:Ljava/lang/String;
    const v8, 0x7f090031

    invoke-virtual {v2, v8}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    .line 66
    .local v1, imgView:Landroid/widget/ImageView;
    const v8, 0x7f090032

    invoke-virtual {v2, v8}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    .line 68
    .local v5, textView:Landroid/widget/TextView;
    const/4 v6, 0x0

    .line 69
    .local v6, themeRes:Landroid/content/res/Resources;
    const/4 v4, 0x0

    .line 71
    .local v4, resId:I
    :try_start_0
    iget-object v8, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->this$0:Lcom/nemustech/regina/ReginaThemeSelector;

    invoke-virtual {v8}, Lcom/nemustech/regina/ReginaThemeSelector;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v8

    invoke-virtual {v8, v7}, Landroid/content/pm/PackageManager;->getResourcesForApplication(Ljava/lang/String;)Landroid/content/res/Resources;
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v6

    .line 76
    :goto_1
    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v9, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->mContext:Landroid/content/Context;

    const v10, 0x7f0700f2

    invoke-virtual {v9, v10}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    const-string v9, "0s"

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    iget-object v9, p0, Lcom/nemustech/regina/ReginaThemeSelector$ThemeAdapter;->mContext:Landroid/content/Context;

    const v10, 0x7f0700f3

    invoke-virtual {v9, v10}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v6, v8, v9, v7}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v4

    .line 78
    if-eqz v4, :cond_0

    .line 79
    invoke-virtual {v6, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v8

    invoke-virtual {v1, v8}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 82
    :cond_0
    invoke-virtual {v5, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 84
    return-object v2

    .line 59
    .end local v1           #imgView:Landroid/widget/ImageView;
    .end local v3           #keyString:Ljava/lang/String;
    .end local v4           #resId:I
    .end local v5           #textView:Landroid/widget/TextView;
    .end local v6           #themeRes:Landroid/content/res/Resources;
    .end local v7           #valueString:Ljava/lang/String;
    :cond_1
    move-object v0, p2

    check-cast v0, Landroid/view/ViewGroup;

    move-object v2, v0

    goto :goto_0

    .line 72
    .restart local v1       #imgView:Landroid/widget/ImageView;
    .restart local v3       #keyString:Ljava/lang/String;
    .restart local v4       #resId:I
    .restart local v5       #textView:Landroid/widget/TextView;
    .restart local v6       #themeRes:Landroid/content/res/Resources;
    .restart local v7       #valueString:Ljava/lang/String;
    :catch_0
    move-exception v8

    goto :goto_1
.end method
